//
//  CustomButton.m
//  openshare框架实现第三方分享及登陆
//
//  Created by zxy on 2018/4/20.
//  Copyright © 2018年 zssh. All rights reserved.
//

#import "CustomButton.h"

@implementation CustomButton

-(void)layoutSubviews{
    [super layoutSubviews];
    CGRect imageRect = self.imageView.frame;
    CGRect titleRect = self.titleLabel.frame;
    
    imageRect.origin.x = self.frame.size.width*0.5 - imageRect.size.width*0.5;
    imageRect.origin.y = 0;
    self.imageView.frame = imageRect;
    
    titleRect.origin.x = 0;
    titleRect.origin.y = imageRect.origin.y + imageRect.size.height;
    titleRect.size.width = self.frame.size.width;
    titleRect.size.height = self.frame.size.height - titleRect.origin.y;
    self.titleLabel.frame = titleRect;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

@end
